-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Photon counting #277
Photon counting #277
Conversation
… fixed a minor error in combine.py almost finished with unit tests for photon counting
so that I can leave the "OPTIONAL" out of the recipe in prescan subtraction since we do want the calibrated bias offset ideally
…tests when it runs
…ssed minor issues 200 and 244
@kjl0025 can you finish filling out the DRP Test Definition row with your test description. It'll actually be helpful for my review to be able to read through the tests at a high level. (Rather than waiting to fill it out after PR review). |
…-checkbox Pr template update with test checkbox
Sure, just finished doing that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kevin, thanks for putting this together. I put some comments throughout.
Some of the other e2e tests (e.g., test_astrom) are failing. I think it's because of the changes to Kgain requiring RN and RN_ERR. Can you fix them? One possibility while fixing them is editing the creation of Kgain so that RN and RN_ERR are things that get defined in it's __init__()
function (so it's never missing, or it throws are error then). Given RN and RN_ERR are now required, it seems like good practice to force the definition of them there.
Happy to discuss other comments (I think some other moderate sized comments are to add some explicit flag to toggle between PC dark creation and PC dark subtraction in the step function, and to make sure your PC recipe goes all the way to the end of L2b processing).
Alright, I think I've addressed all your comments. Should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kevin, two small comments remaining (weird that only one got attached to this comment.. there's another one above). I also need to run the e2e tests myself to make sure they run now, but I will assume you fixed those issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just ran the e2e tests and the input argument naming needs to be fixed in order for the batch pytest framework to run the e2e tests.
Can you also fix the conflict with mock?
Should be good to go now. |
Oops, not yet. Fixing |
'ISPC' is not currently in any files; it will be added, though
…idrp into photon_counting
With the addition of simulation of smearing, the tolerance needed to be increased slightly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kevin, just a few small changes in the code, to conform to some python best practices and hopefully avoid bugs in future development.
Additionally, it seems like header keywords for CMDGAIN and KGAIN have changed. Can you make a new issue to track that we should update these header keywords? I would strongly advocate not doing it in this PR so we can wrap up the last few things and merge!
corgidrp/walker.py
Outdated
elif image.pri_hdr['VISTYPE'] == "PUPILIMG": | ||
recipe_filename = ["l1_to_l2a_nonlin.json", "l1_to_kgain.json"] | ||
else: | ||
recipe_filename = "l1_to_l2b.json" | ||
if 'ISPC' in image.ext_hdr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be an elif
before the else
above? I'd like to keep the logic clean (and easier to debug) using else statements whenever possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to keep dragging this out, but I want to make sure our logic on the walker has no gaps, to avoid bugs in the future.
corgidrp/walker.py
Outdated
recipe_filename = "l1_to_l2b_pc_dark.json" | ||
elif len(unique_vals) > 1: # darks for noisemap creation | ||
recipe_filename = "l1_to_l2a_noisemap.json" | ||
elif len(unique_vals) == 1: # traditional darks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't end on an if
. We should turn this into an else
or have an else
below that raises an Exception.
Same for the 3 other places you have this structure.
also set the number of frames in photon_count_e2e.py back to what it should be. (I set the number of frames to 2 for quick testing.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Describe your changes
Added a step function for photon counting frames. Also addressed some other minor issues. (This is the same as the PR I had into the main branch.)
Type of change
Please delete options that are not relevant (and this line).
Reference any relevant issues (don't forget the #)
#2 , #200 , #244
Checklist before requesting a review